WTL Controls
Back to the WTL Controls Home Page.
BIS_WTL_CONTROLS::CBevel Class Reference

A CStatic descendant which creates a single or two-tone beveled line, oriented horizontally or vertically. More...

#include <Bevel.h>

Inheritance diagram for BIS_WTL_CONTROLS::CBevel:

Public Member Functions

 CBevel () noexcept
 
virtual ~CBevel ()
 
void SubclassStatic (HWND hwnd)
 Subclass a static control window; modify window style to provide the intended graphical appearance. More...
 
void UnSubclassStatic ()
 Un-subclass the window and release GDI resources. More...
 
void SetBevelStyle (CBevelStyle value)
 Set a new CBevelStyle value. More...
 
CBevelStyle GetBevelStyle () const
 Default: CBevelStyle::bsSunken. More...
 
void SetBevelMode (CBevelMode mode)
 Load a new bevel mode. More...
 
CBevelMode GetBevelMode () const
 Default: CBevelMode::bmHorizontal. More...
 

Detailed Description

A CStatic descendant which creates a single or two-tone beveled line, oriented horizontally or vertically.

This simple CStatic descendant handles WM_PAINT to draw a transparent box with a single or two-tone beveled line at either the top or left side. It also responds to WM_SYSCOLORCHANGE or WM_THEMECHANGED messages by updating the pen colors to new, correct colors.

Typical usage is depicted below:

CBevel bevel1;
bevel1.SubclassStatic(GetDlgItem(IDC_BEVEL1));
bevel1.SetBevelStyle(bsRaised);
.
.
.
bevel1.UnSubclassStatic(); // when finished using the control (probably in OnEndDialog).

Definition at line 48 of file Bevel.h.

Constructor & Destructor Documentation

◆ CBevel()

BIS_WTL_CONTROLS::CBevel::CBevel ( )
noexcept

Definition at line 21 of file Bevel.cpp.

◆ ~CBevel()

BIS_WTL_CONTROLS::CBevel::~CBevel ( )
virtual

Definition at line 32 of file Bevel.cpp.

Member Function Documentation

◆ SubclassStatic()

void BIS_WTL_CONTROLS::CBevel::SubclassStatic ( HWND  hwnd)

Subclass a static control window; modify window style to provide the intended graphical appearance.

The WS_EX_TRANSPARENT flag is added to the window style, and a series of flags are removed. The pens

used to draw the bevel are created.

Parameters
hwndHandle to the control window to subclass.
Return values
void

Definition at line 50 of file Bevel.cpp.

◆ UnSubclassStatic()

void BIS_WTL_CONTROLS::CBevel::UnSubclassStatic ( )

Un-subclass the window and release GDI resources.

Definition at line 65 of file Bevel.cpp.

◆ SetBevelStyle()

void BIS_WTL_CONTROLS::CBevel::SetBevelStyle ( CBevelStyle  style)

Set a new CBevelStyle value.

Parameters
styleThe new bevel style.
Return values
void

Definition at line 93 of file Bevel.cpp.

◆ GetBevelStyle()

CBevelStyle BIS_WTL_CONTROLS::CBevel::GetBevelStyle ( ) const

Default: CBevelStyle::bsSunken.

Return values
CBevelStyleThe current bevel style.

Definition at line 79 of file Bevel.cpp.

◆ SetBevelMode()

void BIS_WTL_CONTROLS::CBevel::SetBevelMode ( CBevelMode  mode)

Load a new bevel mode.

Parameters
modeThe new bevel mode.
Return values
void

Definition at line 120 of file Bevel.cpp.

◆ GetBevelMode()

CBevelMode BIS_WTL_CONTROLS::CBevel::GetBevelMode ( ) const

Default: CBevelMode::bmHorizontal.

Return values
CBevelModeThe current bevel mode.

Definition at line 106 of file Bevel.cpp.


The documentation for this class was generated from the following files: